<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>给曹悦童的生日卡片</title>
    <style>
        @font-face{
            font-family: cute;
            src:url("./cute.ttf");
        }
        @font-face {
            font-family: italic;
            src: url('./Italic 01.ttf');
        }
        *{
            margin:0px;
            padding:0px;
            cursor:default;
            font-family: cute;
        }
        #cover{
            background-color: pink;
        }
        #main {
            width:100%;
            height:800px;
            display:flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;

        }
        #bg{
            position: absolute;
            width:100%;
            height:800px;
            background-image: url('72441709_p0.png');
            background-repeat: no-repeat;
            background-position:center;
            opacity: 0.5;
        }
        #title{
            z-index:2;
            display:flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        #title>h1{
            color:white;
            font-size: 80px;
            font-weight:100;
            word-spacing: 10px;
            letter-spacing:5px;
            font-family: cute;
        }
        #title>h2{
            color:bisque;
            font-size:60px;
            font-weight: 100;
            word-spacing: 10px;
            letter-spacing: 5px;
            font-family: italic;
            margin:50px;
        }
        #topBar{
            position:fixed;
            width:100%;
            opacity:0.5;
            background-color:orange;
            top:0px;
        }
        #apex{
            width:100%;
            height:20px;
            cursor:pointer;
        }
        #menu{
            cursor:pointer;
            height:50px;
            line-height: 50px;
            text-align: center;
        }
        #letter{
            display:flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            line-height: 50px;
            color:darkslategrey;
            opacity: 0.8;
        }
        .waifu{
            float:left;
            z-index:10;
            position: fixed;
            left:0px;
            bottom:0px;
        }
    </style>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>

<body>
    <div id=cover>
    <div id='main'>
        <div id='bg'>
        </div>
        <div id = 'topBar' class='dropdown-toggle'>
            <div id='apex'>
            </div>
            <div id='menu' class='next'>
                    
            </div>
        </div>


        <div id='title'>
            <h1>祝曹悦童生日快乐</h1>
            <h2>happy birthday</h2>
        </div>

        <div id='letter'>
            <h1>亲爱的童童 <strong>亲启</strong></h1>
            <p>不知不觉我们已经在一起快一年啦</p>
            <p>感谢这宝贝一年的陪伴，童童又长老了一岁，离童阿姨不远了，hhh</p>
            <p>这一年里，我们相互生气过，也相互安慰过，一起努力过</p>
            <p>但是ACCA还是不要落下啊啊啊啊！！！</p>
            <p>但是ACCA还是不要落下啊啊啊啊！！！</p>
            <p>但是ACCA还是不要落下啊啊啊啊！！！</p>
            <p>重要的事情说三遍，看你最近没有提，怕你忘记了</p>
            <p>接下来的日子，让我们继续一起走下去吧</p>
            <p>加油，干巴爹(ง •̀_•́)ง</p>
        </div>

    </div>
    <div class="waifu" >
        <div class="waifu-tips"></div>
        <canvas id="live2d" width="280" height="250" class="live2d"></canvas>
        <div class="waifu-tool">
            <span class="fui-home"></span>
            <span class="fui-chat"></span>
            <span class="fui-eye"></span>
            <span class="fui-user"></span>
            <span class="fui-photo"></span>
            <span class="fui-info-circle"></span>
            <span class="fui-cross"></span>
        </div>
        </div>
    </div>

        
    <script src="assets/waifu-tips.js"></script>
    <script src="assets/live2d.js"></script>
    <script type="text/javascript">initModel("assets/")</script>
    <script>
        $("#menu").slideUp();
        $("#letter").hide();
        let page1 = "祝曹悦童生日快乐";
        let page2 = "致亲爱的童童";
        let curPage = 1;
        $("#menu").text(page2);
        let menuDown = 0;
        let menuDownTime = 300;
        let menuUpTime = 300;
        let hideTime = 500;
        let showTime = 500;

        function menuSlideDown(){
            if(menuDown!=0)
                console.log("ERROR:menuDown should be 0");
            $("#menu").slideDown(menuDownTime);
            menuDown=1;}
        function menuSlideUp(){
            if(menuDown!=1)
                console.log("ERROR:menuDown should be 1");
            $("#menu").slideUp(menuUpTime);
            menuDown=0;}

        $("#apex").click(function(){
            if(menuDown === 0)
                menuSlideDown();
            else
                menuSlideUp();
        })
        // $("#menu").mouseout(function(){
        //     if(menuDown === 1)
        //         menuSlideUp();
        // })
        $("#apex").mouseenter(function(){
            if(menuDown === 0)
                menuSlideDown();
        })

        $("#menu").click(function(){
            if(curPage === 1){
                $("#title").hide(hideTime,function(){
                $("#menu").text(page1);
                $("#letter").show(showTime);
                curPage = 2;
                });
            }
            else if(curPage === 2){
                $("#letter").hide(hideTime,function(){
                    $("#menu").text(page2);
                    $("#title").show(showTime);
                    curPage = 1;
                })
            }

        })

        
    </script>
</body>
</html>